package com.ldc.commonlibs.ui;

import android.view.LayoutInflater;
import android.view.ViewGroup;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.viewbinding.ViewBinding;

import com.ldc.commonlibs.common.ViewModelBase;

/**
 * @author liudc
 * @since 2022/7/3 13:50
 */
public abstract class VMFragmentBase<VB extends ViewBinding, VM extends ViewModelBase> extends VFragmentBase<VB> {
    protected VM viewModel;

    @Override
    protected VB loadingViewBinding(@NonNull LayoutInflater inflater, @Nullable ViewGroup container) {
        viewModel = initViewModel();
        return super.loadingViewBinding(inflater, container);
    }

    protected abstract VM initViewModel();
}
